home *** CD-ROM | disk | FTP | other *** search
Wrap
property pState, pSprite, pButtonRl, pButtonUp, pButtonDn, pSNDdn, pSNDup, pDestination, pMyButton global gMarkerList on beginSprite me set pSprite to the currentSpriteNum resetMyButton() set pState to #off end on mouseDown me set the member of sprite pSprite to pButtonDn set pMyButton to pSprite puppetSound(4, pSNDdn) updateStage() end on mouseUp me if pMyButton = pSprite then set the member of sprite pSprite to pButtonRl puppetSound(4, pSNDup) set pState to #on updateStage() if pDestination = "*VOID*" then else puppetSound(2, 0) go(pDestination) end if end if sendAllSprites(#resetMyButton) end on mouseUpOutSide me set the member of sprite pSprite to pButtonUp set pState to #off updateStage() sendAllSprites(#resetMyButton) end on mouseEnter me set the member of sprite pSprite to pButtonRl if the stillDown = 1 then if pMyButton = pSprite then set the member of sprite pSprite to pButtonDn end if end if updateStage() end on mouseLeave me set the member of sprite pSprite to pButtonUp updateStage() end on resetMyButton set pMyButton to 0 end on getPropertyDescriptionList me set gMarkerList to [] repeat with x = 1 to the number of lines in the labelList set litem to line x of the labelList if litem <> EMPTY then add(gMarkerList, litem) end if end repeat set lup to the name of member the memberNum of sprite the currentSpriteNum set lrl to char 1 to the number of chars in lup - 2 of lup & "rl" set ldn to char 1 to the number of chars in lup - 2 of lup & "dn" set description to [:] addProp(description, #pButtonRl, [#default: lrl, #format: #bitmap, #comment: "Button Roll:"]) addProp(description, #pButtonUp, [#default: lup, #format: #bitmap, #comment: "Button Up:"]) addProp(description, #pButtonDn, [#default: ldn, #format: #bitmap, #comment: "Button Down:"]) addProp(description, #pSNDdn, [#default: "S - MouseDown", #format: #sound, #comment: "Down Sound:"]) addProp(description, #pSNDup, [#default: "S - MouseUp", #format: #sound, #comment: "Up Sound:"]) addProp(description, #pDestination, [#default: "*VOID*", #format: #string, #comment: "Go To Marker:", #range: gMarkerList]) return description end on getBehaviorDescription me return "This behavior allows for a button with an up, down, and rollover state." & RETURN & "Drag and drop this on any button, then select the up, down and rollover states of the button, as well as the sounds the button is to make when clicked and the destination the button is to send the user to." & RETURN & "You can call on the pState of sprite X to find out if the button is on or off." end